package com.shopping.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.shopping.dao.AddressDao;
import com.shopping.dao.UserInforDao;
import com.shopping.po.Address;
import com.shopping.service.AddressService;


@Service
@Transactional
public class AddressServiceImpl implements AddressService {
	@Autowired
	private AddressDao addressDao;
	public List<Address> selectAddressById(Integer user_id){
		return addressDao.selectAddressById(user_id);
		
	}
	public void insertAddress(String adr,String detail,String name,String phone,String mail,Integer user_id) {
		addressDao.insertAddress(adr,detail,name,phone,mail,user_id);
	}
	public void deleteAddress(Integer address_id) {
		addressDao.deleteAddress(address_id);
	}
	
	public Address selectAddressByAId(Integer address_id) {
		return addressDao.selectAddressByAId(address_id);
	}
	
	public void updateAddressByAId(String adr,String detail,String name,String phone,String mail,Integer address_id) {
		addressDao.updateAddressByAId(adr,detail,name,phone,mail,address_id);
	}
}
